home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJDEV111.ZIP / include / dos.h < prev    next >
C/C++ Source or Header  |  1993-10-11  |  2KB  |  101 lines

  1. #ifndef _DOS_H_
  2. #define _DOS_H_
  3.  
  4. union REGS {
  5.   struct {
  6.     unsigned long ax;
  7.     unsigned long bx;
  8.     unsigned long cx;
  9.     unsigned long dx;
  10.     unsigned long si;
  11.     unsigned long di;
  12.     unsigned long cflag;
  13.     unsigned long flags;
  14.   } x;
  15.   struct {
  16.     unsigned char al;
  17.     unsigned char ah;
  18.     unsigned short upper_ax;
  19.     unsigned char bl;
  20.     unsigned char bh;
  21.     unsigned short upper_bx;
  22.     unsigned char cl;
  23.     unsigned char ch;
  24.     unsigned short upper_cx;
  25.     unsigned char dl;
  26.     unsigned char dh;
  27.     unsigned short upper_dx;
  28.   } h;
  29. };
  30.  
  31. struct SREGS {
  32.   unsigned short cs;
  33.   unsigned short ds;
  34.   unsigned short es;
  35.   unsigned short fs;
  36.   unsigned short gs;
  37.   unsigned short ss;
  38. };
  39.  
  40. struct ftime {
  41.   unsigned ft_tsec:5;    /* 0-29, double to get real seconds */
  42.   unsigned ft_min:6;    /* 0-59 */
  43.   unsigned ft_hour:5;    /* 0-23 */
  44.   unsigned ft_day:5;    /* 1-31 */
  45.   unsigned ft_month:4;    /* 1-12 */
  46.   unsigned ft_year:7;    /* since 1980 */
  47. };
  48.  
  49. struct date {
  50.   short da_year;
  51.   char  da_day;
  52.   char  da_mon;
  53. };
  54.  
  55. struct time {
  56.   unsigned char ti_min;
  57.   unsigned char ti_hour;
  58.   unsigned char ti_hund;
  59.   unsigned char ti_sec;
  60. };
  61.  
  62. struct dfree {
  63.   unsigned df_avail;
  64.   unsigned df_total;
  65.   unsigned df_bsec;
  66.   unsigned df_sclus;
  67. };
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73. int bdos(int func, unsigned dx, unsigned al);
  74. int bdosptr(int func, void *dx, unsigned al);
  75. int int86(int ivec, union REGS *in, union REGS *out);
  76. int int86x(int ivec, union REGS *in, union REGS *out, struct SREGS *seg);
  77. int intdos(union REGS *in, union REGS *out);
  78. int intdosx(union REGS *in, union REGS *out, struct SREGS *seg);
  79.  
  80. void enable(void);
  81. void disable(void);
  82.  
  83. int getftime(int handle, struct ftime *ftimep);
  84. int setftime(int handle, struct ftime *ftimep);
  85.  
  86. int getcbrk(void);
  87. int setcbrk(int new_value);
  88.  
  89. void getdate(struct date *);
  90. void gettime(struct time *);
  91. void setdate(struct date *);
  92. void settime(struct time *);
  93.  
  94. void getdfree(unsigned char drive, struct dfree *ptr);
  95.  
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99.  
  100. #endif
  101.